package com.sky.mapper.admin;


import com.github.pagehelper.Page;
import com.sky.annotation.AutoFill;
import com.sky.dto.EmployeePageQueryDTO;
import com.sky.enumeration.OperationType;
import com.sky.pojo.Employee;
import org.apache.ibatis.annotations.*;


public interface EmployeeMapper {

    /*
     * 员工列表分页查询
     * */
    Page<Employee> selectPageByName(String name);

    /*
     * 新增员工
     * @param employee
     * */
    @AutoFill(OperationType.INSERT)
    void insert(Employee employee);

    /**
     * 根据用户名查询员工
     *
     * @param username
     * @return
     */
    @Select("select * from employee where username = #{username}")
    Employee getByUsername(String username);

    /*
    * 启用禁用员工账号
    * */
    void updateStatus(Employee employee);

    /*
    * 回显员工信息功能
    * */
    Employee getById(Long id);
    /*
    * 编辑员工信息
    * */
    @AutoFill(OperationType.UPDATE)
    void update(Employee employee);
}
